<template>
	<view class="work-container">
		<!-- 轮播图 -->
		<uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
			<swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
				<swiper-item v-for="(item, index) in data" :key="index">
					<view class="swiper-item" @click="clickBannerItem(item)">
						<image :src="item.image" style="width: 710rpx;height: 240rpx;" :draggable="false" />
					</view>
				</swiper-item>
			</swiper>
		</uni-swiper-dot>

		<!-- 宫格组件 -->
		<uni-section title="全部应用" type="line"></uni-section>
		<view class="grid-body">
			<uni-grid :column="3" :showBorder="false">
				<uni-grid-item v-if="checkPermi(['develop:ProjectBaseInfo:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/oder/index')">
						<image :src="baseUrl + '/profile/upload/mini/1.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">订单管理</text>
					</view>
				</uni-grid-item>
			<!-- 	<uni-grid-item>
					<view class="grid-item-box" @click="goto1()">
						<uni-icons type="staff-filled" size="30"></uni-icons>
						<text class="text">订单管理</text>
					</view>
				</uni-grid-item> -->
				<uni-grid-item v-if="checkPermi(['develop:PayApply:audit'])">
					<view class="grid-item-box"  @click="gotoPage('/pagesA/purchase/index')" >
						<image :src="baseUrl + '/profile/upload/mini/2.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">采购管理</text>
					</view>
				</uni-grid-item>
				<uni-grid-item v-if="checkPermi(['develop:PayApply:audit'])">
					<view class="grid-item-box"  @click="gotoPage('/pagesA/addInvoice/index')" >
						<image :src="baseUrl + '/profile/upload/mini/2.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">上传发票</text>
					</view>
				</uni-grid-item>
				<uni-grid-item v-if="checkPermi(['develop:PayApply:audit'])">
					<view class="grid-item-box"  @click="gotoPage('/pagesA/remit/index')" >
						<image :src="baseUrl + '/profile/upload/mini/2.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">打款审核</text>
					</view>
				</uni-grid-item>
				<uni-grid-item v-if="checkPermi(['develop:PayApply:audit'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/invoice/index')" >
						<image :src="baseUrl + '/profile/upload/mini/3.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">付款申请单</text>
					</view>
				</uni-grid-item>
				<uni-grid-item v-if="checkPermi(['develop:qinggou:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/inventory/index')" >
						<image :src="baseUrl + '/profile/upload/mini/4.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">请购管理</text>
					</view>
				</uni-grid-item>
				<uni-grid-item v-if="checkPermi(['develop:PayRecord:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/paymentRecord/index')" >
						<image :src="baseUrl + '/profile/upload/mini/5.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">付款记录</text>
					</view>
				</uni-grid-item>
				<uni-grid-item v-if="checkPermi(['develop:daohuo:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/receivingRecord/index')" >
						<image :src="baseUrl + '/profile/upload/mini/6.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">到货记录</text>
					</view>
				</uni-grid-item>
				<uni-grid-item v-if="checkPermi(['develop:yiruju:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/godownRecord/index')" >
						<image :src="baseUrl + '/profile/upload/mini/7.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">入库记录</text>
					</view>
				</uni-grid-item>
				<!-- <uni-grid-item v-if="checkPermi(['develop:fahuojilu:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/shipmentsAdmin/index')" >
						<image :src="baseUrl + '/profile/upload/mini/8.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">发货管理</text>
					</view>
				</uni-grid-item> -->
				<uni-grid-item v-if="checkPermi(['develop:fahuojilu:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/releaseRecord/index')" >
						<image :src="baseUrl + '/profile/upload/mini/8.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">发货记录</text>
					</view>
				</uni-grid-item>
				<!-- <uni-grid-item v-if="checkPermi(['develop:supplierBalance:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/supplierRecord/index')" >
						<image :src="baseUrl + '/profile/upload/mini/9.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">供应商收支</text>
					</view>
				</uni-grid-item> -->
				<uni-grid-item v-if="checkPermi(['develop:zhijian:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/pollingList/index?tableIndex=0')">
						<image :src="baseUrl + '/profile/upload/mini/10.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">巡检记录</text>
					</view>
				</uni-grid-item>
				<uni-grid-item v-if="checkPermi(['develop:zhijian:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/qualityTesting/index')">
						<image :src="baseUrl + '/profile/upload/mini/11.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">质检记录</text>
					</view>
				</uni-grid-item>
				<uni-grid-item v-if="checkPermi(['develop:fahuojilu:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/goodsaleList/index')">
						<image :src="baseUrl + '/profile/upload/mini/12.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">产品发货详情</text>
					</view>
				</uni-grid-item>
				<uni-grid-item v-if="checkPermi(['develop:WeiwanchengTask:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/mine/productiveTask/index?tableIndex=2')">
						<image :src="baseUrl + '/profile/upload/mini/13.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">我的任务</text>
					</view>
				</uni-grid-item>
				<uni-grid-item v-if="checkPermi(['develop:WeiwanchengTask:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/reportRecord/index')">
						<image :src="baseUrl + '/profile/upload/mini/14.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">报工记录</text>
					</view>
				</uni-grid-item>
				<uni-grid-item v-if="checkPermi(['develop:toAssess:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/warehousingAudit/index')">
						<image :src="baseUrl + '/profile/upload/mini/14.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">入库审核</text>
					</view>
				</uni-grid-item>
				<uni-grid-item v-if="checkPermi(['develop:fahuoshenhe:list'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/deliveryAudit/index?tableIndex=1')">
						<image :src="baseUrl + '/profile/upload/mini/14.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">发货管理</text>
					</view>
				</uni-grid-item>
				<uni-grid-item v-if="checkPermi(['develop:daohuoGoods:listList'])">
					<view class="grid-item-box" @click="gotoPage('/pagesA/arriveTest/index')" >
						<image :src="baseUrl + '/profile/upload/mini/6.png'" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">到货产品</text>
					</view>
				</uni-grid-item>
			<!-- 	<uni-grid-item>
					<view class="grid-item-box" @click="gotoPage('/pages/inspectionAudit/index')">
						<image src="https://luneng.wanhedashuju.com:8013/prod-api/profile/upload/2024/12/13/icon4_20241213092058A006.png" style="width: 90rpx;height: 90rpx;margin-bottom: 10rpx;" mode=""></image>
						<text class="text">报工记录</text>
					</view>
				</uni-grid-item> -->
				<!-- <uni-grid-item>
					<view class="grid-item-box">
						<uni-icons type="bars" size="30"></uni-icons>
						<text class="text">字典管理</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box">
						<uni-icons type="gear-filled" size="30"></uni-icons>
						<text class="text">参数设置</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box">
						<uni-icons type="chat-filled" size="30"></uni-icons>
						<text class="text">通知公告</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box">
						<uni-icons type="wallet-filled" size="30"></uni-icons>
						<text class="text">日志管理</text>
					</view>
				</uni-grid-item> -->
			</uni-grid>
		</view>
	</view>
</template>

<script>
	import config from '@/config'
	const baseUrl = config.baseUrl
	export default {
		data() {
			return {
				baseUrl:config.baseUrl,
				current: 0,
				swiperDotIndex: 0,
				data: [
					{
						image: baseUrl + '/profile/upload/mini/0.png'
					}
				]
			}
		},
		methods: {
			gotoPage(url) {
				uni.navigateTo({
				  url: url
				});
			},
			clickBannerItem(item) {
				console.info(item)
			},
			changeSwiper(e) {
				this.current = e.detail.current
			},
			changeGrid(e) {
				console.log(e, '这里是什么啊')
				this.$modal.showToast('模块建设中~')
			}
		}
	}
</script>

<style lang="scss">
	/* #ifndef APP-NVUE */
	page {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		background-color: #fff;
		min-height: 100%;
		height: auto;
	}

	view {
		font-size: 14px;
		line-height: inherit;
	}

	/* #endif */

	.text {
		text-align: center;
		font-size: 26rpx;
		margin-top: 10rpx;
	}

	.grid-item-box {
		flex: 1;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
	}

	.uni-margin-wrap {
		width: 690rpx;
		width: 100%;
		;
	}

	.swiper {
		height: 300rpx;
	}

	.swiper-box {
		height: 150px;
	}

	.swiper-item {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		justify-content: center;
		align-items: center;
		color: #fff;
		height: 300rpx;
		line-height: 300rpx;
	}

	@media screen and (min-width: 500px) {
		.uni-swiper-dot-box {
			width: 400px;
			/* #ifndef APP-NVUE */
			margin: 0 auto;
			/* #endif */
			margin-top: 8px;
		}

		.image {
			width: 100%;
		}
	}
</style>